package emulator.cbm;

public class Petscii {
	public static byte asc2pet(char ch)
    {
        if (
            ch >= 0x5B && 
            ch <= 0x7E)
        {
            return (byte)(ch ^ 0x20);
        }
        else if (ch >= 'A' && ch <= 'Z')
        {
            return (byte)(ch | 0x80);
        }
        else if (ch == 0x0a)
        {
            return 0x0D;
        }
        return (byte)ch;
    }

}
